1 /* 2 * This file is part of gtkD. 3 * 4 * gtkD is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU Lesser General Public License 6 * as published by the Free Software Foundation; either version 3 7 * of the License, or (at your option) any later version, with 8 * some exceptions, please read the COPYING file. 9 * 10 * gtkD is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public License 16 * along with gtkD; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA 18 */ 19 20 // generated automatically - do not change 21 // find conversion definition on APILookup.txt 22 // implement new conversion functionalities on the wrap.utils pakage 23 24 25 module sourceview.HoverProviderT; 26 27 public import gio.AsyncResultIF; 28 public import gio.Cancellable; 29 public import glib.ErrorG; 30 public import glib.GException; 31 public import sourceview.HoverContext; 32 public import sourceview.HoverDisplay; 33 public import sourceview.c.functions; 34 public import sourceview.c.types; 35 36 37 /** 38 * Interface to populate interactive tooltips. 39 * 40 * `GtkSourceHoverProvider` is an interface that should be implemented to extend 41 * the contents of a [class@HoverDisplay]. This is typical in editors that 42 * interact external tooling such as those utilizing Language Server Protocol. 43 * 44 * If you can populate the [class@HoverDisplay] synchronously, use 45 * [vfunc@HoverProvider.populate]. Otherwise, interface implementations that 46 * may take additional time should use [vfunc@HoverProvider.populate_async] 47 * to avoid blocking the main loop. 48 */ 49 public template HoverProviderT(TStruct) 50 { 51 /** Get the main Gtk struct */ 52 public GtkSourceHoverProvider* getHoverProviderStruct(bool transferOwnership = false) 53 { 54 if (transferOwnership) 55 ownedRef = false; 56 return cast(GtkSourceHoverProvider*)getStruct(); 57 } 58 59 60 /** */ 61 public void populateAsync(HoverContext context, HoverDisplay display, Cancellable cancellable, GAsyncReadyCallback callback, void* userData) 62 { 63 gtk_source_hover_provider_populate_async(getHoverProviderStruct(), (context is null) ? null : context.getHoverContextStruct(), (display is null) ? null : display.getHoverDisplayStruct(), (cancellable is null) ? null : cancellable.getCancellableStruct(), callback, userData); 64 } 65 66 /** */ 67 public bool populateFinish(AsyncResultIF result) 68 { 69 GError* err = null; 70 71 auto __p = gtk_source_hover_provider_populate_finish(getHoverProviderStruct(), (result is null) ? null : result.getAsyncResultStruct(), &err) != 0; 72 73 if (err !is null) 74 { 75 throw new GException( new ErrorG(err) ); 76 } 77 78 return __p; 79 } 80 }